package com.fpd.controller;

import com.fpd.model.ro.*;
import com.fpd.model.vo.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;

import com.fpd.annotation.LoginCheck;
import com.fpd.annotation.SystemControllerLog;
import com.fpd.model.entity.CaseAllBatch;
import com.fpd.model.entity.CustomerBaseInfo;
import com.fpd.model.entity.CustomerCaseInfo;
import com.fpd.model.entity.CustomerRelationInfo2;
import com.fpd.model.entity.CustomerRelativeInfo;
import com.fpd.service.CustomerBaseInfoService;
import com.fpd.tools.DateUtil;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

import java.math.BigDecimal;
import java.util.Arrays;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletResponse;

/**
 * @desc 客户基础信息控制器
 * @author wujiangbo
 * @date 2019年11月6日 下午1:40:05
 */
@Api(tags = "客户基础信息相关接口")
@Controller
@RequestMapping(value = "/cust", produces = "application/json;charset=UTF-8")
public class CustomerBaseInfoController {

	@Autowired
	CustomerBaseInfoService customerBaseInfoService;
	
    
    @RequestMapping(value="/importCust", method = RequestMethod.GET)
    @ResponseBody
    public ResultVO importCust(){
    	CustomerBaseInfo customer1 = new CustomerBaseInfo();
    	customer1.setId("1110");
    	customer1.setBeginTime(DateUtil.parseStrToDate("2021-03-01",DateUtil.DATE_TIME_FORMAT_YYYYMMDD));//开始委案日期
    	customer1.setEndTime(DateUtil.parseStrToDate("2021-04-29",DateUtil.DATE_TIME_FORMAT_YYYYMMDD));
    	customer1.setDataTime("1");
    	customer1.setContractCount(11);
    	customer1.setEntityNo("1");
    	customer1.setCustName("第一个");
    	customer1.setEntrustId("111");
    	customer1.setCustIdNumber("324213");
    	customer1.setCustNo("eeee");
    	customer1.setYuqiAmount(new BigDecimal(120.98));
    	
    	CustomerBaseInfo customer2 = new CustomerBaseInfo();
    	customer2.setId("2220");
    	customer2.setBeginTime(DateUtil.parseStrToDate("2021-11-01",DateUtil.DATE_TIME_FORMAT_YYYYMMDD));//开始委案日期
    	customer2.setEndTime(DateUtil.parseStrToDate("2021-11-29",DateUtil.DATE_TIME_FORMAT_YYYYMMDD));
    	customer2.setDataTime("1");
    	customer2.setContractCount(22);
    	customer2.setEntityNo("1");
    	customer2.setCustName("第二个");
    	customer2.setEntrustId("222");
    	customer2.setCustIdNumber("324223");
    	customer2.setCustNo("eeee");
    	customer2.setYuqiAmount(new BigDecimal(220.98));
    	
    	CustomerBaseInfo customer3 = new CustomerBaseInfo();
    	customer3.setId("3330");
    	customer3.setCustName("第三个");
    	customer3.setBeginTime(DateUtil.parseStrToDate("2021-12-01",DateUtil.DATE_TIME_FORMAT_YYYYMMDD));//开始委案日期
    	customer3.setEndTime(DateUtil.parseStrToDate("2022-01-29",DateUtil.DATE_TIME_FORMAT_YYYYMMDD));
    	customer3.setDataTime("2");
    	customer3.setContractCount(33);
    	customer3.setEntityNo("2");
    	customer3.setEntrustId("333");
    	customer3.setCustIdNumber("334333");
    	customer3.setCustNo("eeee");
    	customer3.setYuqiAmount(new BigDecimal(330.98));
    	
    	customerBaseInfoService.saveBatch(Arrays.asList(customer1,customer2,customer3));
        return new ResultVO();
    }
	
}
